<%-- 
    Document   : cadSuprimentos
    Created on : 11/03/2011, 15:36:13
    Author     : jonathas
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!-- Declaração das Tags da biblioteca RichFaces -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <style>.cols{
            vertical-align:top;
        }
    </style>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link href="../css/estilomodelo.css" rel="stylesheet" type="text/css" />

            <title>CADASTRO DE AREA | Sistema Gestão de Suprimentos - SGS</title>
        </head>
        <body>
            <div id="container">
                <div id="banner">
                </div><%--Banner--%>

                <div  id="conteudoCad">
                    <h:form>
                        <rich:panel style="width:752px; height:200px; background-color:#EEEEEE;">
                            <f:facet name="header">
                                <h:outputText value="Cadastro Área"  ></h:outputText>
                            </f:facet>
                            <h:panelGrid columns="3">
                                <h:outputText  value="Obra: "/>
                                <rich:comboBox id="obra"  defaultLabel="Obras"  value="#{ObjFacadeArea.area.obra}" converter="ConverterObraList" required="true">
                                    <f:selectItems value="#{ObjDAO.obras}"/>
                                </rich:comboBox>
                                <rich:message for="funcionario"/>

                                <h:outputText value="Nome: "/>
                                <rich:inplaceInput id="valor" value="#{ObjFacadeArea.area.nome}" defaultLabel="Digite o nome" required="true" />
                                <rich:message for="valor"/>

                                <h:outputText value="Numero: "/>
                                <rich:inplaceInput id="numero" value="#{ObjFacadeArea.area.numero}" defaultLabel="Digite o numero" required="true" />
                                <rich:message for="numero"/>

                                <a4j:commandButton value="Alterar" action="#{ObjFacadeArea.alterarArea}" />
                                <a4j:commandButton value="Cadastro" action="#{ObjFacadeArea.cancelaArea}" />
                            </h:panelGrid>

                        </rich:panel>
                    </h:form>
                </div><%--Conteúdo--%>
                <div align="center" id="tableCad">
                    <h:form>
                        <rich:dataTable style="width:740px;" id="area" border="1" value="#{ObjDAO.allArea}" rendered="#{not empty ObjDAO.allArea}"  var="c" rows="4">
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Id"/>
                                </f:facet>
                                <center> <h:outputText value="#{c.idArea}"/></center>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Nome"/>
                                </f:facet>
                                <center> <h:outputText value="#{c.nome}"/></center>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Numero"/>
                                </f:facet>
                                <center> <h:outputText value="#{c.numero}"/></center>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Obra"/>
                                </f:facet>
                                <center> <h:outputText value="#{c.obra}" converter="ConverterObraTable"/></center>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Excluir"/>
                                </f:facet>
                                <center> <h:commandButton value="excluir" action="#{ObjFacadeArea.excluiArea}" image="../imagens/icon/excluir.gif" ></center>
                                    <f:setPropertyActionListener target="#{ObjFacadeArea.area}" value="#{c}"/>
                                </h:commandButton>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Alterar"/>
                                </f:facet>
                                <center> <h:commandButton value="alterar" action="editar" image="../imagens/icon/alterar.gif" ></center>
                                    <f:setPropertyActionListener target="#{ObjFacadeArea.area}" value="#{c}"/>
                                </h:commandButton>
                            </h:column>
                            <f:facet name="footer">
                                <rich:datascroller />
                            </f:facet>
                        </rich:dataTable>
                    </h:form>
                </div><%--Tabela--%>


                <div id="rodape">
                </div><%--Rodapé--%>
            </div><%--Container--%>
        </body>
    </html>

</f:view>
